<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var year = prompt("请输入年份");
    var yuefen = prompt("请输入月份");
    if(yuefen==4||yuefen==6||yuefen==9||yuefen==11){
    alert(30);
    }else if(yuefen==2) {
        if (year % 4 == 0 && year % 100 !== 0 || year % 400 == 0) {
            alert(29);
        } else {
            alert(28);
        }
    }else{
        alert(31);
    }
</script>
</body>
</html>